home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Games / WHDLoad / Install Templates / Std-Files Install / Install < prev    next >
Encoding:
Text File  |  2001-09-19  |  3.8 KB  |  209 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "data")            ;sub directory containing data files
  4. (set #readme-file "ReadMe")        ;name of readme file
  5. (set #highs-file "highs")        ;name of high scores file
  6. (set #cleanup "")            ;files to delete after install
  7.  
  8. ;****************************
  9. ;----------------------------
  10. ; checks if given program is installed, if not abort install
  11. ; #program - to check
  12.  
  13. (procedure P_ChkRun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort
  18.       (cat
  19.     "You must install \"" #program "\" first!\n"
  20.     "It must be accessible via the path.\n"
  21.     "You can find it in the WHDLoad package."
  22.       )
  23.     )
  24.   )
  25. )
  26.  
  27. ;----------------------------
  28. ; Wait for inserting disk
  29. ; IN:  #AD_disk - name of disk
  30. ; OUT: -
  31.  
  32. (procedure P_disk
  33.   (askdisk
  34.     (dest #AD_disk)
  35.     (prompt ("\nInsert Disk \"%s\" in any drive!" #AD_disk))
  36.     (help @askdisk-help)
  37.   )
  38. )
  39.  
  40. ;****************************
  41.  
  42. (if
  43.   (exists #readme-file)
  44.   (if
  45.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  46.     ("")
  47.     (run ("SYS:Utilities/More %s" #readme-file))
  48.   )
  49. )
  50.  
  51. (set #program "WHDLoad")
  52. (P_ChkRun)
  53.  
  54. (if
  55.   (getenv "WHDLInstPath")
  56.   (set @default-dest (getenv "WHDLInstPath"))
  57. )
  58. (set @default-dest
  59.   (askdir
  60.     (prompt ("Where should \"%s\" be installed?\nA drawer \"%s\" will be automatically created." @app-name @app-name))
  61.     (help @askdir-help)
  62.     (default @default-dest)
  63.     (disk)
  64.   )
  65. )
  66. (run ("setenv WHDLInstPath \"%s\"" @default-dest))
  67. (set #dest (tackon @default-dest @app-name))
  68. (if
  69.   (exists #dest)
  70.   (
  71.     (set #choice
  72.       (askbool
  73.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted?" #dest))
  74.         (default 1)
  75.         (choices "Delete" "Skip")
  76.         (help @askbool-help)
  77.       )
  78.     )
  79.     (if
  80.       (= #choice 1)
  81.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  82.     )
  83.   )
  84. )
  85. (makedir #dest
  86.   (help @makedir-help)
  87.   (infos)
  88. )
  89.  
  90. ;----------------------------
  91.  
  92. (copyfiles
  93.   (help @copyfiles-help)
  94.   (source ("%s.Slave" @app-name))
  95.   (dest #dest)
  96. )
  97. (if
  98.   (exists ("%s.newicon" @app-name))
  99.   (set #icon
  100.     (askchoice
  101.       (prompt "\nWhich icon would you like to install?\n")
  102.       (default 0)
  103.       (choices "Normal" "NewIcon")
  104.       (help @askchoice-help)
  105.     )
  106.   )
  107.   (set #icon 0)
  108. )
  109. (select #icon
  110.   (set #icon ("%s.inf" @app-name))
  111.   (set #icon ("%s.newicon" @app-name))
  112. )
  113. (copyfiles
  114.   (help @copyfiles-help)
  115.   (source #icon)
  116.   (newname ("%s.info" @app-name))
  117.   (dest #dest)
  118. )
  119. (tooltype
  120.   (dest (tackon #dest @app-name))
  121.   (settooltype "Slave")
  122.   (settooltype "PreLoad")
  123. )
  124. (tooltype
  125.   (dest (tackon #dest @app-name))
  126.   (settooltype "PreLoad" "")
  127.   (settooltype "Slave" ("%s.Slave" @app-name))
  128.   (setdefaulttool "WHDLoad")
  129.   (setstack 10240)
  130.   (noposition)
  131. )
  132. (if
  133.   (exists #readme-file)
  134.   (copyfiles
  135.     (help @copyfiles-help)
  136.     (source #readme-file)
  137.     (dest #dest)
  138.   )
  139. )
  140. (if
  141.   (exists ("%s.info" #readme-file))
  142.   (
  143.     (copyfiles
  144.       (help @copyfiles-help)
  145.       (source ("%s.info" #readme-file))
  146.       (dest #dest)
  147.     )
  148.     (tooltype
  149.       (dest (tackon #dest #readme-file))
  150.       (noposition)
  151.     )
  152.   )
  153. )
  154.  
  155. (if
  156.   (= #sub-dir "")
  157.   ("")
  158.   (
  159.     (set #dest (tackon #dest #sub-dir))
  160.     (makedir #dest
  161.       (help @makedir-help)
  162.     )
  163.   )
  164. )
  165. (if
  166.   (exists #highs-file)
  167.   (copyfiles
  168.     (help @copyfiles-help)
  169.     (source #highs-file)
  170.     (dest #dest)
  171.   )
  172. )
  173.  
  174. ;----------------------------
  175.  
  176. (set #AD_disk "Oscar1")
  177. (P_disk)
  178. (copyfiles
  179.   (help @copyfiles-help)
  180.   (source ("%s:" #AD_disk))
  181.   (dest #dest)
  182.   (pattern "~(00|11|s)")
  183. )
  184. (rename (tackon #dest "10") (tackon #dest "exe"))
  185.  
  186. (set #AD_disk "Oscar2")
  187. (P_disk)
  188. (copyfiles
  189.   (help @copyfiles-help)
  190.   (source ("%s:" #AD_disk))
  191.   (dest #dest)
  192.   (pattern "~(00)")
  193. )
  194.  
  195. (set #AD_disk "Oscar3")
  196. (P_disk)
  197. (copyfiles
  198.   (help @copyfiles-help)
  199.   (source ("%s:" #AD_disk))
  200.   (dest #dest)
  201.   (pattern "~(00)")
  202. )
  203.  
  204. ;----------------------------
  205.  
  206. (run ("Delete %s ALL QUIET FORCE" #cleanup))
  207.  
  208. (exit)
  209.